home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1998 January / PC Answers Issue 49 Cover CD January 1998.iso / Apps / Director / DATA.Z / Widget Wizard.dir / WidgtBehaviors_78_UI Rollover Change Pointer .ls < prev    next >
Encoding:
Text File  |  1997-05-10  |  2.1 KB  |  60 lines

  1. property outcurs, incurs, incursSet, customImage, customMask, oldcursor
  2.  
  3. on translate_cursor me, setting
  4.   case setting of
  5.     #none:
  6.       set val to 0
  7.     #arrow:
  8.       set val to -1
  9.     #IBeam:
  10.       set val to 1
  11.     #crosshair:
  12.       set val to 2
  13.     #crossbar:
  14.       set val to 3
  15.     #watch:
  16.       set val to 4
  17.     #invisible:
  18.       set val to 200
  19.     #Custom:
  20.       set val to [member the customImage of me, member the customMask of me]
  21.   end case
  22.   return val
  23. end
  24.  
  25. on beginSprite me
  26.   set oldcursor to the cursor of sprite the spriteNum of me
  27.   set val to translate_cursor(me, the incursSet of me)
  28.   set the cursor of sprite the spriteNum of me to val
  29. end
  30.  
  31. on endSprite me
  32.   set the cursor of sprite the spriteNum of me to oldcursor
  33. end
  34.  
  35. on getPropertyDescriptionList
  36.   set description to [:]
  37.   if the currentSpriteNum = 0 then
  38.     set CursDefault to 0
  39.     set CursMaskDefault to 0
  40.   else
  41.     set memref to the member of sprite the currentSpriteNum
  42.     set castLibNum to the castLibNum of memref
  43.     set CursDefault to member (the memberNum of member memref + 1) of castLib castLibNum
  44.     set CursMaskDefault to member (the memberNum of member memref + 2) of castLib castLibNum
  45.   end if
  46.   addProp(description, #incursSet, [#comment: "Pointer Image:", #format: #symbol, #range: [#none, #arrow, #IBeam, #crosshair, #crossbar, #watch, #invisible, #Custom], #default: #Custom])
  47.   addProp(description, #customImage, [#comment: "Custom Image:", #format: #bitmap, #default: CursDefault])
  48.   addProp(description, #customMask, [#comment: "Custom Mask:", #format: #bitmap, #default: CursMaskDefault])
  49.   return description
  50. end
  51.  
  52. on getBehaviorDescription
  53.   return "Display a designated Pointer Image when over the sprite.  " & RETURN & "PARAMETERS:" & RETURN & "ΓÇó Pointer Image - built in pointer to be displayed." & RETURN & "ΓÇó Custom Image  - ( optional ) number of castmember used as cursor image.  Ignored when Pointer Image is not set to Custom." & RETURN & "ΓÇó Custom Mask - ( optional ) number of castmember used as mask image.  Ignored when Pointer Image is not set to Custom."
  54. end
  55.  
  56. on getAssocMembers
  57.   set myPropList to [customImage, customMask]
  58.   return myPropList
  59. end
  60.